#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
print(f"Python解释器路径: {sys.executable}")
print(f"Python版本: {sys.version}")

try:
    import pymysql
    print(f"成功导入pymysql模块，版本: {pymysql.__version__}")
    # 尝试连接数据库
    try:
        conn = pymysql.connect(host='192.140.166.115', user='phoenixfm_cn', password='3b7SiXCWSe8B6pyi', database='phoenixfm_cn')
        print("成功连接数据库")
        conn.close()
    except Exception as e:
        print(f"数据库连接失败: {e}")
except ImportError as e:
    print(f"导入pymysql失败: {e}")
    # 打印sys.path以检查模块搜索路径
    print("Python模块搜索路径:")
    for path in sys.path:
        print(f"  {path}")